#include <iostream>
#include "Udpserver.hpp"
#include "Route.hpp"
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        std::cerr << "pelase ./server port" << std::endl;
        exit(3);
    }
    ENABLE_CONSOLE_LOG_STRATEGY();
    u_int16_t port = std::stoi(argv[1]);

    // Route
    Route r;

    // server
    Udpserver server(port, [&r](int sockfd, const std::string &message, InetAddr &Id) {
        r.MessageRoute(sockfd,message,Id);
    });
    server.Start();
    return 0;
}
